import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router'

@Component({
  selector: 'eq-home',
  templateUrl: './home.component.html'
})
export class HomeComponent implements OnInit {
  title = 'eq-home';
  code: string;
  backtestId: number;

  constructor(
    private router: Router
  ) {}

  ngOnInit() {}

  // 跳转至执行对应code的均线策略
  ngOnBuildByCode() {
    console.log('ngOnBuildByCode')

    if (this.code) {

      // 创建策略 返回策略id 同时执行回测
      // 返回的回测id
      this.backtestId = 1;
      this.router.navigate(['/console/algorithm-info/', this.backtestId]);
    };
  }
}
